package Text_64;

import java.util.ArrayList;
import java.util.Collections;

public class Code {

	public static void main(String[] args) {
		 ArrayList<String> list = new ArrayList<>();


	        //添加元素
	        Collections.addAll(list,"qwe","xawd","zcj","ijjw");

	        System.out.println(list);
	        //打乱
	       // Collections.shuffle(list);
	        //System.out.println(list);
	        Collections.swap(list,0,3);
	        System.out.println(list);

	        ArrayList<Integer> list1 = new ArrayList<>();
	        ArrayList<Integer> list2 = new ArrayList<>();
	        Collections.addAll(list1,2,9,3,7,4,8,6,1,0,11);
	        Collections.addAll(list2,0,0,0,0,0,0,0,0,0,0);
	        System.out.println(list1);

	        //默认排序
	        Collections.sort(list1);
	        System.out.println(list1);
	        //最大值
	        System.out.println(Collections.max(list1));
	        //最小值
	        System.out.println(Collections.min(list1));
	        //list1 复制到list2中
	        Collections.copy(list2,list1);
	        System.out.println(list1);
	        System.out.println(list2);

	}

}
